<div id="reviewCarousel" class="reviews carousel slide">
    <div class="fnt-size16 font-opensansilt txtfff" id="reviews_text_success" style="margin: 4px;text-align: center;"></div>
    <ul class="carousel-inner">
        <?php
       $reviewdetails = TrainerProfileReview::getAllReviewTrainnerprofile($profiles->user_id);
      
        if (!empty($reviewdetails)) {
            $i = 1;
            foreach ($reviewdetails as $key => $value) {            
                $profile = Users::getFrontEndUser($value->from_user_id); 
                if ($profile['photo'] <> "") {
                    $imgsrc = baseUrl() . '../../' . getUploadDir() . $value->from_user_id . '/profile/minithumb/' . $profile['photo'];
                } else {
                    $imgsrc = baseUrl() . '../../upload/default-mini.png';
                }
                ?>
                <li class="item <?php echo ($i == 1) ? 'active' : ''; ?>">
                    <span class="floatL"><img src="<?php echo $imgsrc; ?>" /></span>
                    <div class="userReview">
                        <?php                       
                        echo '<p class="fnt-size16 font-opensansilt txtfff">' . $profile['first_name'] . '   ' . $profile['last_name'] . '</p>';
                        echo '<p class="fnt-size14 font-opensansilt txtfff">' . substr($value->reviews_text, 0, 250) . '......</p>';
                        ?></div>
                </li>
                <?php
                $i++;
            }
        } else {
            echo ' <li class="item">' . Message::NO_REVIEWS_MSG . '</li>';
        }
        ?>
    </ul>   
</div>
<?php
$afterLoginUser = Users::getFrontEndUser(getLoginUserId());
if(!empty($_GET)){
if (!empty($afterLoginUser)) {

    if ($afterLoginUser->photo <> "") {
        $imgsrc = baseUrl() . '../../' . getUploadDir() . $afterLoginUser->user_id . '/profile/minithumb/' . $afterLoginUser->photo;
    } else {
        $imgsrc = baseUrl() . '../../upload/default-mini.png';
    }
    ?>
    <div class="reviewEntry">                            
        <span class="floatL"><img src="<?php echo $imgsrc; ?>" /></span>
        <input type="text" class="reviewField" placeholder="Add Reviews" id="addNewReview">
    </div>
<?php } else { ?>
    <div class="reviewEntry">
        <a href="javascript:void(0)" id="writeRbtn" class="btn">Write Review</a>
    </div>
<?php }} ?>